﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PayManage
{

     /// <summary>
    /// 单表结构
    /// </summary>
    [Serializable]
    public class ExcelSheetsConfig
    {
        /// <summary>
        /// 多少月份的工资
        /// </summary>
        public string  Month { get; set; }

        /// <summary>
        /// 当前系统账户
        /// </summary>
        public List<SheetConfigEntity> Sheets { get; set; }

        public ExcelSheetsConfig()
        {
            Month = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            Sheets = new List<SheetConfigEntity>();
        }
      
    }
    /// <summary>
    /// 单表结构
    /// </summary>
    [Serializable]
    public class SheetConfigEntity
    {
        /// <summary>
        /// sheet表名称
        /// </summary>
        public string SheetName { get; set; }

        /// <summary>
        /// 表格数据开始行
        /// </summary>
        public int StartRowIndex { get; set; }

        /// <summary>
        /// 表格数据最大列
        /// </summary>
        public int ColumnsCount { get; set; }

        /// <summary>
        /// 当前系统账户
        /// </summary>
        public List<ColumnConfigEntity> Columns { get; set; }
      

        public SheetConfigEntity()
        {
            SheetName = "";
            StartRowIndex = 0;
            ColumnsCount = 1;
            Columns = new List<ColumnConfigEntity>();          
          
        }
    }

      /// <summary>
    /// 单表结构
    /// </summary>
    [Serializable]
    public class ColumnConfigEntity
    {
        /// <summary>
        /// 在所有列中的索引
        /// </summary>
        public int ColumnIndex { set; get; }

        /// <summary>
        /// 字段id
        /// </summary>
        public string Id { set; get; }

        /// <summary>
        /// 显示文字
        /// </summary>
        public string HeadText { set; get; }

        /// <summary>
        /// 是否冻结
        /// </summary>
        public bool IsFrozen { set; get; }

        /// <summary>
        /// 是否隐藏
        /// </summary>
        public bool IsHidden { set; get; }  
        /// <summary>
        /// 字段类型
        /// </summary>
        public string type { set; get; }

        /// <summary>
        /// 必须是保存公式,
        /// </summary>
        public bool MustMethod { set; get; }

        /// <summary>
        /// 字段类型
        /// </summary>
        public string CountMethod{ set; get; }

        /// <summary>
        /// 该列既可以保存公式,又可以保存值,保存的时候，如果值！=计算的值，优先保存值
        /// </summary>
        public bool SetOrMethod { set; get; }

        /// <summary>
        /// 是否可以批量设置
        /// </summary>
        public bool CanSetDefault { set; get; }

        /// <summary>
        /// 没有公式的字段默认值，保存excel的时候只保存值
        /// </summary>
        public string DefaultValue { set; get; }

        /// <summary>
        /// 是否是索引
        /// </summary>
        public bool IsIndex { set; get; }

        /// <summary>
        /// 是否是自动序列
        /// </summary>
        public bool IsAutoNum { set; get; }


        /// <summary>
        /// 是否根据时间计算,如年资奖
        /// </summary>
        public bool IsWithDate { set; get; }

        /// <summary>
        /// 是否是全勤奖，全勤奖， 实际上班=标准出勤 ，具体数额
        /// </summary>
        public bool IsAllWorkAWard { set; get; }

        public ColumnConfigEntity()
        {
            ColumnIndex = 0;
            Id = "id";
            HeadText = "HeadText";
            IsFrozen = false;
            IsHidden = false;
            type = "string";
            MustMethod = false;
            CountMethod = "";
            SetOrMethod = false;
            CanSetDefault = false;
            DefaultValue = string.Empty;
            IsIndex = false;
            IsAutoNum = false;
            IsWithDate = false;
            IsAllWorkAWard = false;
        }
    }
}
